import {createRouter, createWebHistory} from 'vue-router'
import LoginView from '../views/login.vue'

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '/',
            name: 'login',
            component: LoginView
        },
        {
            path: '/index',
            name: 'index',
            component: () => import('../views/index.vue'),
            children: [
                {
                    path: "/system/user",
                    name: "sys_user",
                    component: () => import('../views/sys/user.vue')
                },
                {
                    path: "/system/role",
                    name: "sys_role",
                    component: () => import('../views/sys/role.vue')
                },
                {
                    path: "/system/menu",
                    name: "sys_menu",
                    component: () => import('../views/sys/menu.vue')
                },
                {
                    path: "/products/product",
                    name: "Products",
                    component: () => import('../views/product/Products.vue')
                }
            ]
        },
        {
            path: '/view',
            name: 'car',
            component: () => import('../views/sys/view.vue')
        },
    ]
})

export default router
